home *** CD-ROM | disk | FTP | other *** search
/ USA Bestseller / USA BESTSELLER Vol 1-95 (Hepp-Computer)(1995).iso / e214 / hyperapi.txt < prev    next >
Text File  |  1994-10-17  |  9KB  |  286 lines

  1. ;-----------------------------------------------------------------------------
  2. ;
  3. ;
  4. ;             HyperWare Application Program Interface (API)
  5. ;
  6. ;
  7. ;-----------------------------------------------------------------------------
  8. ;
  9. ; HyperWare products share a common DOS multiplex Interrupt number (Int 2F).
  10. ; The following key factors apply to the interface operations:
  11. ;
  12. ; The DOS Multiplex Interrupt Number (INT 2f) is incrementally searched to
  13. ; find a free multiplex number. The beginning number is 0DFh. If this number
  14. ; is in use, then 0C0h,0C1h,0C2h,... are each quired until a free number
  15. ; is found.
  16. ;
  17. ; Each HyperWare Product uses a unique Product Code placed in the BX register,
  18. ; specifing the intended product for communications.
  19. ;
  20. ; Currently installation checks exist for all HyperWare products.
  21. ; HyperDisk also provides simple inquire and selections of the major cacheing
  22. ; functions. 
  23. ;
  24. ;
  25. ;-----------------------------------------------------------------------------
  26. ;
  27. ; HyperDisk installation check.
  28. ;
  29. ; Call and return register descriptions for Interrupt 2Fh:
  30. ;
  31. ; Calling Registers:
  32. ;
  33. ;    AH = Trial Multiplex Number     ; Initially 0DFh
  34. ;    AL = 00h              ; Installed?? request code
  35. ;    BX ='DH'            ; Disk, HyperWare
  36. ;    CX = 00h            ; Clear to comfirm return codes
  37. ;    DX = 00h            ; Clear to comfirm return codes
  38. ;
  39. ;
  40. ; Return Registers, Case 1 nothing installed using the Trial Multiplex Number:
  41. ;
  42. ;    AL = 00h            ; Nothing install
  43. ;
  44. ;
  45. ; Return Registers, Case 2 something install, not HyperWare product:
  46. ;
  47. ;    AL = 0FFh            ; Multiplex Number in use
  48. ;
  49. ;    CX = not 'YH'            ; not a HyperWare Product!
  50. ;                    ; increment Trial Multiplex Number
  51. ;                    ; and try again until either a free
  52. ;                    ; number found, or a HyperWare product
  53. ;                    ; found, or Multiplex Number > 0FFh.
  54. ;
  55. ;
  56. ; Return Registers, Case 3 HyperWare product, but not HyperDisk
  57. ;
  58. ;    AL = 0FFh            ; Multiplex Number in use
  59. ;
  60. ;    CX = 'YH'            ; HyperWare Product selected by BX
  61. ;                    ; is installed.
  62. ;                    ; 
  63. ;    DX = 00h            ; zero indicates selected product not
  64. ;                    ; found
  65. ;
  66. ;
  67. ; Return Registers, Case 4 HyperDisk installed!
  68. ;    AH = HyperWare Multiplex Number    ; result of multiplex # search
  69. ;    AL = 0FFh              ; Number in use
  70. ;    BX = CS segment of HyperDisk    ; Valid if DX not zero
  71. ;
  72. ;    CX = 'YH'              ; HyperWare Product selected by BX
  73. ;                    ; is installed.
  74. ;
  75. ;    DX = HyperDisk Local Data Version # (Not HyperDisk Product Version)
  76. ;
  77. ;
  78. ;
  79. ;--------------------------------------------------------------------------
  80. ;
  81. ;
  82. ; Example assembly language:
  83. ;
  84.  
  85. HyperCallout        db    0DFh        ; Dos MultiPlex Number for HyperWare
  86.  
  87. HyDkProductCode    equ    'DH'            ; Product Code for HyperDisk
  88.  
  89. HyKyProductCode    equ    'KH'            ; Product Code for HyperKey
  90.  
  91. HyScProductCode    equ    'SH'            ; Product Code for HyperScreen
  92.  
  93. HyScProductCode    equ    'BH'            ; Product Code for HyperStb
  94.  
  95. ;-----------------------------------------------------------------------------
  96.  
  97. SearchHyAPI    proc    near
  98.     mov    ax,352fh        ; get vector for Dos Multiplex
  99.     int    21h            ; call dos
  100.     mov    cx,es            ; must not be zero!
  101.     jcxz    short SearchHyAPIRet    ; if zero then no multiplex established
  102.  
  103. SearchHyAPILp:
  104.     xor    cx,cx            ; zero cx
  105.     xor    dx,dx            ; zero dx
  106.     mov    bx,HydkProductCode    ; Looking for HyperDisk
  107.  
  108.     mov    ah,HyperCallOut        ; Disk Cache installed?
  109.     xor    al,al            ; install check request
  110.  
  111.     push    ds            ; make sure not changed
  112.     int    2fh            ; go do multiplex interrupt
  113.     pop    ds
  114.  
  115.     or    al,al            ; zero...no change
  116.     je    short SearchHyAPIRet    ; nothing installed
  117.  
  118.     cmp    al,-1            ; something installed is -1
  119.     jne    short SearchHyAPINxt    ; try next Multiplex number if not -1
  120.  
  121.     cmp    cx,'YH'            ; HyperWare Product?
  122.     jne    short SearchHyAPINxt    ; if not skip to next Multiplex number
  123.  
  124.     or    dx,dx            ; non-zero if HyperDisk installed
  125.     jz    short SearchHyAPIRet    ; HyperDisk not here
  126.  
  127. SearchHyAPIFound:            ; Found Product, Carry is clear
  128.     ret                ; AH = Multiplex #
  129.                     ; BX = CS segment of HyperDisk
  130.                     ; DX = HyperDisk Local Data Version #
  131.  
  132.  
  133. SearchHyAPINxt:
  134.     inc    HyperCallOut        ; Disk Cache installed?
  135.     jnz    short SearchHyAPILp    ; stop at 0FFh
  136.  
  137. SearchHyAPIRet:
  138.     stc                ; not found, carry Set
  139.     ret
  140.  
  141.  
  142. SearchHyAPI    endp
  143.  
  144. ;
  145. ;-----------------------------------------------------------------------------
  146. ;
  147. ;
  148. ; Get Current HyperDisk Cache State
  149. ;
  150. ; Call and return register descriptions for Interrupt 2Fh:
  151. ;
  152. ; Calling Registers:
  153. ;
  154. ;    AH = Multiplex Number    ; Value determined by Install Check
  155. ;    AL = 01h        ; Get current HyperDisk Cache State
  156. ;    BX ='DH'        ; Product = Disk, HyperWare
  157. ;
  158. ;
  159. ; Return Registers:
  160. ;
  161. ;    AX = 0000h        ; function supported
  162. ;    BX = UsedBuffers    ; number of cache buffers in use
  163. ;    CX = ModifiedBuffers    ; number of modified buffers
  164. ;    DL = Current Cache values: 0 = Disabled, 1 = Enabled
  165. ;         Bit 0..StagedFloppy: Stage Write floppy drive write operations
  166. ;         Bit 1....StagedHard: Stage Write hard drive write operations
  167. ;          Bit 2..VerifyFloppy: Verify floppy drive write operations
  168. ;          Bit 3....VerifyHard: Verify hard drive write operations
  169. ;          Bit 4.....Reserved0: Reserved always 0
  170. ;          Bit 5.....Reserved1: Reserved always 0
  171. ;          Bit 6..FloppyEnable: Enable floppy caching
  172. ;          Bit 7..CacheEnabled: Enable all caching functions
  173. ;
  174. ;
  175. ;
  176. ; Example assembly language:
  177. ;
  178. ;
  179.     mov    ah,HyperCallOut        ; HyperWare Multiplex Number
  180.     mov    bx,HydkProductCode    ; HyperDisk product selector
  181.     mov    al,01h            ; Get current cache state
  182.  
  183.     int    2fh            ; do multiplex interrupt
  184.  
  185.                     ; AX = 0, if supported
  186. ;                     ; BX = UsedBuffers    
  187. ;                     ; CX = ModifiedBuffers    
  188. ;
  189. ;                     ; Bit x: 0 = Disabled, 1 = Enabled
  190. ;                    ; DL = Bit 0..StagedFloppy
  191. ;                    ;      Bit 1....StagedHard
  192. ;                    ;      Bit 2..VerifyFloppy
  193. ;                    ;      Bit 3....VerifyHard
  194. ;                    ;      Bit 4.....Reserved0
  195. ;                     ;      Bit 5.....Reserved1
  196. ;                     ;      Bit 6..FloppyEnable
  197. ;                    ;      Bit 7..CacheEnabled
  198. ;
  199. ;
  200. ;-----------------------------------------------------------------------------
  201. ;
  202. ;
  203. ; Set HyperDisk Cache State, return previous Cache State
  204. ;
  205. ;
  206. ; Call and return register descriptions for Interrupt 2Fh:
  207. ;
  208. ; Calling Registers:
  209. ;
  210. ;    AH = Multiplex Number    ; Value determined by Install Check
  211. ;    AL = 01h        ; Get current HyperDisk Cache State
  212. ;    BX ='DH'        ; Product = Disk, HyperWare
  213. ;    DL = New Cache values: 0 = Disabled, 1 = Enabled
  214. ;         Bit 0..StagedFloppy: Stage Write floppy drive write operations
  215. ;         Bit 1....StagedHard: Stage Write hard drive write operations
  216. ;          Bit 2..VerifyFloppy: Verify floppy drive write operations
  217. ;          Bit 3....VerifyHard: Verify hard drive write operations
  218. ;          Bit 4.....Reserved0: Reserved always 0
  219. ;          Bit 5.....Reserved1: Reserved always 0
  220. ;          Bit 6..FloppyEnable: Enable floppy caching
  221. ;          Bit 7..CacheEnabled: Enable all caching functions
  222. ;
  223. ;
  224. ;
  225. ; Return Registers:
  226. ;
  227. ;    AX = 0000h        ; function supported and asynchronously queued
  228. ;    BX = UsedBuffers    ; number of cache buffers in use
  229. ;    CX = ModifiedBuffers    ; number of modified buffers
  230. ;    DH = Previous Cache values: 0 = Disabled, 1 = Enabled
  231. ;         Bit 0..StagedFloppy: Stage Write floppy drive write operations
  232. ;         Bit 1....StagedHard: Stage Write hard drive write operations
  233. ;          Bit 2..VerifyFloppy: Verify floppy drive write operations
  234. ;          Bit 3....VerifyHard: Verify hard drive write operations
  235. ;          Bit 4.....Reserved0: Reserved always 0
  236. ;          Bit 5.....Reserved1: Reserved always 0
  237. ;          Bit 6..FloppyEnable: Enable floppy caching
  238. ;          Bit 7..CacheEnabled: Enable all caching functions
  239. ;
  240. ;
  241. ;
  242. ; Example assembly language:
  243. ;
  244. ;
  245.     mov    ah,HyperCallOut        ; HyperWare Multiplex Number
  246.     mov    bx,HydkProductCode    ; HyperDisk product selector
  247.  
  248.     mov    dl,11001111b        ; DL = Bit 0..StagedFloppy
  249.                     ;      Bit 1....StagedHard
  250.                     ;      Bit 2..VerifyFloppy
  251.                      ;      Bit 3....VerifyHard
  252.                      ;      Bit 4.....Reserved0
  253.                      ;      Bit 5.....Reserved1
  254.                      ;      Bit 6..FloppyEnable
  255.                      ;      Bit 7..CacheEnabled
  256.                      ;
  257.     mov    al,02h            ; Set current cache state
  258.  
  259.     int    2fh            ; do multiplex interrupt
  260.  
  261.                     ; AX = 0, if supported
  262. ;                     ; BX = UsedBuffers    
  263. ;                     ; CX = ModifiedBuffers    
  264. ;                     ;
  265. ;                    ; DH = Bit 0..StagedFloppy
  266. ;                    ;      Bit 1....StagedHard
  267. ;                    ;      Bit 2..VerifyFloppy
  268. ;                    ;      Bit 3....VerifyHard
  269. ;                    ;      Bit 4.....Reserved0
  270. ;                     ;      Bit 5.....Reserved1
  271. ;                     ;      Bit 6..FloppyEnable
  272. ;                    ;      Bit 7..CacheEnabled
  273. ;
  274. ;
  275. ;-----------------------------------------------------------------------------
  276. ;
  277. ;
  278. ;
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.